#ifndef CVSETTINGS_H
#define CVSETTINGS_H

#include <QObject>
#include <QSettings>
#include <QList>
#include <QDataStream>

#include "model/account.h"
struct CVSetting
{
    QString m_network; // network url
    QString m_userId; // user login id
    QString m_password; // user login password

};

class CVSettings : public QObject
{
    Q_OBJECT
public:
    ~CVSettings();
    static CVSettings *get();

    void addAccount(const QString &network, const QString &email, const QString &password);
    void addAccount(Account *account);

    QList<Account *> *getAccounts();
signals:
    
public slots:
private:
    CVSettings();
    static CVSettings *instance;

    void init();
    QString getFileName();
    void readSettings();
    void writeFile();

    QSettings *settings;
    QList<Account *> *accounts;
};

#endif // CVSETTINGS_H
